//
//  DHStoreTypeCell.m
//  宏达APP
//
//  Created by DIANGHONG on 2018/5/6.
//  Copyright © 2018年 123. All rights reserved.
//

#import "DHStoreTypeCell.h"
@interface DHStoreTypeCell()
@property (strong, nonatomic)  UIButton *selfSupport; // 自营

@end

@implementation DHStoreTypeCell
- (UIButton *)selfSupport{
    if (!_selfSupport) {
        _selfSupport = [[UIButton alloc] init];
        //  [_giftButton setBackgroundColor:UIColor.blueColor];
        [_selfSupport setTitle:@"平台自营" forState:UIControlStateNormal];
        [_selfSupport setTitleColor:UIColor.lightGrayColor forState:UIControlStateNormal];
        [_selfSupport setTitleColor:UIColor.whiteColor forState:UIControlStateSelected];
        _selfSupport.titleLabel.font = [UIFont systemFontOfSize:12];
        [_selfSupport setBackgroundImage:[UIImage imageNamed:@"buttonBgImageNor"] forState:UIControlStateNormal];
        [_selfSupport setBackgroundImage:[UIImage imageNamed:@"buttonBgImageSelected"] forState:UIControlStateSelected];
        [_selfSupport addTarget:self action:@selector(ButtonCilck:) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return _selfSupport;
}

- (void)ButtonCilck:(UIButton *)sender{
    sender.selected = YES;

}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    [self.contentView addSubview:self.selfSupport];
    
    //CGFloat btnW = (self.bounds.size.width - 5 * 8) / 5;
    CGFloat btnH = self.bounds.size.height - 2 * 8;
    
    self.selfSupport.frame = CGRectMake(8, 5, 60, btnH);
}
@end
